﻿using System;
using System.Collections.Generic;

namespace ETModel
{
    /// <summary>
    /// Actor消息分发组件,处理来自分发类型的邮筒里的消息,根据消息主体本身的类型,转发给对应的actor处理器(IMActorHandler),全局唯一
    /// </summary>
    public class ActorMessageDispatcherComponent : Component
	{
		public readonly Dictionary<Type, IMActorHandler> ActorMessageHandlers = new Dictionary<Type, IMActorHandler>();

		public override void Dispose()
		{
			if (this.IsDisposed)
			{
				return;
			}
			base.Dispose();

			this.ActorMessageHandlers.Clear();
		}
	}
}